import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const user = JSON.parse(sessionStorage.getItem("user"))
const menus = JSON.parse(sessionStorage.getItem("menus"))

export default new Vuex.Store({
  state: {
    token: sessionStorage.getItem("ACCESS_TOKEN"),
    user: user,
    menuRouter: menus
  },
  mutations: {
    setUser(state, user){
      state.user = user
    },
    setToken(state, token){
      state.token = token
    },
    setMenuRouter(state, menus){
      state.menuRouter = menus
    }
  },
  getters:{
  },
  actions: {
  },
  modules: {
  }
})
